//
//  HHKeyboardInfo.m
//  ZHUIKit
//
//  Created by Basic on 2018/2/12.
//

#import "HHKeyboardInfo.h"


#pragma mark - HHKeyboardInfo(model)
@interface HHKeyboardInfo()
- (void)fillKeyboardInfoWithDuration:(CGFloat)duration frameBegin:(CGRect)frameBegin frameEnd:(CGRect)frameEnd heightIncrement:(CGFloat)heightIncrement action:(NSInteger )action isSameAction:(BOOL)isSameAction;
@end

@implementation HHKeyboardInfo
- (void)fillKeyboardInfoWithDuration:(CGFloat)duration frameBegin:(CGRect)frameBegin frameEnd:(CGRect)frameEnd heightIncrement:(CGFloat)heightIncrement action:(NSInteger )action isSameAction:(BOOL)isSameAction {
    self.animationDuration = duration;
    self.frameBegin = frameBegin;
    self.frameEnd = frameEnd;
    self.heightIncrement = heightIncrement;
    self.action = action;
    self.isSameAction = isSameAction;
}
@end




#pragma mark - UIView+HHKeyboardUtil
@implementation UIView (HHKeyboardUtil)
- (void)findControllerWithResultController:(UIViewController **)resultController {
    UIResponder *responder = [self nextResponder];
    if (nil == responder) {
        return;
    }
    if ([responder isKindOfClass:[UIViewController class]]) {
        *resultController = (UIViewController *)responder;
    } else if ([responder isKindOfClass:[UIView class]]) {
        [(UIView *)responder findControllerWithResultController:resultController];
    }
}
@end
